package cn.openbiotoken.impl;

import cn.openbiotoken.Biometrics;
import cn.openbiotoken.Landmark;

public class LandmarkImpl implements Landmark {

    public LandmarkImpl(final float x, final float y, final float confidencePercentage) {
        this.x = x;
        this.y = y;
        this.confidencePercentage = Biometrics.legalizeConfidencePercentage((int)confidencePercentage);
    }

    private final float x;
    private final float y;
    private final byte confidencePercentage;

    @Override
    public float getX() {
        return x;
    }

    @Override
    public float getY() {
        return y;
    }

    @Override
    public byte getConfidencePercentage() {
        return confidencePercentage;
    }

    @Override
    public boolean isConfident() {
        return confidencePercentage>CONFIDENCE_LINE;
    }
}
